package baseTest;

public class diameterOfBinaryTree {
    int ans = 1;

    public int process(TreeNode root){
        if (root == null){
            return 0;
        }
        int L =process(root);
        int R = process(root);
        ans = Math.max(ans,(L+R)+1);
        return Math.max(L,R)+1;
    }
}
